<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>PrimeFaces</title>
            </f:facet>
        </h:head>

        <h:body>

            <p:layout fullPage="true">

                <p:layoutUnit position="north" size="100" resizable="true" closable="true" collapsible="true">
                    Header
                </p:layoutUnit>

                <p:layoutUnit position="south" size="100" closable="true" collapsible="true">
                    Footer
                </p:layoutUnit>

                <p:layoutUnit position="west" size="175" header="Left" collapsible="true">
                    <h:form>
                    <p:menu>
                        <p:submenu label="Resources">
                            <p:menuitem value="Demo" url="http://www.primefaces.org/showcase-labs/ui/home.jsf" />
                            <p:menuitem value="Documentation" url="http://www.primefaces.org/documentation.html" />
                            <p:menuitem value="Forum" url="http://forum.primefaces.org/" />
                            <p:menuitem value="Themes" url="http://www.primefaces.org/themes.html" />

                        </p:submenu>

                    </p:menu>
                        </h:form>
                </p:layoutUnit>

                <p:layoutUnit position="center">
                    
                    <h:form id="forma">
                        <p:growl id="growl" showDetail="true" sticky="true" />
                        
                        <p:panelGrid id="formulario">
                            <p:row>
                                <p:column><h:outputText value="Codigo del Pais:"/> </p:column>
                                <p:column>
                                    <p:inputText id="txtNumero" binding="#{VistaPais.txtCodPais}"/>
                                </p:column>
                                <p:column>
                                    <h:outputText value="Nombre:"/>
                                </p:column>
                                <p:column>
                                    <p:inputText id="txtNombre" binding="#{VistaPais.txtNombrePais}"/>
                                </p:column>
                            </p:row>
                            <p:row>
                                <p:column>
                                    
                                    <p:commandButton id="btnRegistrar" binding="#{VistaPais.btnRegistrar}" 
                                                     action="#{VistaPais.funcion_Registrar()}" value="Registrar"
                                                     update="growl,formulario,tabla"/>
                                    
                                </p:column>
                            
                          
                                <p:column>
                                    
                                    <p:commandButton id="btnModificar"  disabled="true" binding="#{VistaPais.btnModificar}" 
                                                     action="#{VistaPais.funcion_Modificar}" value="Modificar"
                                                     update="growl,formulario,tabla" />
                                    
                                </p:column>
                          
                                <p:column>
                                    
                                    <p:commandButton id="btnLimpiar"   binding="#{VistaPais.btnLimpiar}" 
                                                     action="#{VistaPais.funcion_Limpiar}" value="Limpiar"
                                                     update="growl,formulario,tabla" />
                                    
                                </p:column>
                           
                                <p:column>
                                    
                                    <p:commandButton id="btnEliminar"  disabled="true" binding="#{VistaPais.btnEliminar}" 
                                                     action="#{VistaPais.funcion_Eliminar}" value="Eliminar"
                                                     update="growl,formulario,tabla"/>
                                    
                                </p:column>
                            </p:row>
                            
                            
                            
                        </p:panelGrid>
                        
                        <p:dataTable  id="tabla" var="paises" value="#{VistaPais.listaPaises}" rows="10"
                         paginator="true"
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15" selectionMode="single" selection="#{clienteVista.clienteSeleccionado}" rowKey="#{clientes.cliCedula}">
                            
                            
                            <p:ajax event="rowSelect" listener="#{VistaPais.paisSeleccionado}" update=":forma:formulario" />
                         
        <p:column headerText="Codigo del Pais">
            <h:outputText value="#{paises.codPais}" />
        </p:column>
 
        <p:column headerText="Nombre">
            <h:outputText value="#{paises.nombrePais}" />
        </p:column>
 
     </p:dataTable>
</h:form>
                    
                </p:layoutUnit>

            </p:layout>

        </h:body>

    </f:view>
</html>

